<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/duck/laptop_io.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('laptop__io_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">laptop_io.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;<a class="el" href="platform_8h_source.html">gbdk/platform.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="stdint_8h_source.html">stdint.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="stdbool_8h_source.html">stdbool.h</a>&gt;</code><br />
</div>
<p><a href="laptop__io_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a4a3361568d0c8ca82bcfe8ddfeacf0e5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a4a3361568d0c8ca82bcfe8ddfeacf0e5">_MEGADUCK_LAPTOP_IO_H</a></td></tr>
<tr class="separator:a4a3361568d0c8ca82bcfe8ddfeacf0e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad92c78a25f1c8de2615722c7eddfe1da"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#ad92c78a25f1c8de2615722c7eddfe1da">DUCK_IO_CMD_INIT_START</a>&#160;&#160;&#160;0x00u</td></tr>
<tr class="separator:ad92c78a25f1c8de2615722c7eddfe1da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48d85e878da85076ef25868769130cf8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a48d85e878da85076ef25868769130cf8">DUCK_IO_CMD_GET_KEYS</a>&#160;&#160;&#160;0x00u</td></tr>
<tr class="separator:a48d85e878da85076ef25868769130cf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5731dbc5b3308811e62c457fee15c5c9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a5731dbc5b3308811e62c457fee15c5c9">DUCK_IO_CMD_DONE_OR_OK</a>&#160;&#160;&#160;0x01u</td></tr>
<tr class="separator:a5731dbc5b3308811e62c457fee15c5c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a460c1f9f52da868754ec07af8f023f33"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a460c1f9f52da868754ec07af8f023f33">DUCK_IO_CMD_ABORT_OR_FAIL</a>&#160;&#160;&#160;0x04u</td></tr>
<tr class="separator:a460c1f9f52da868754ec07af8f023f33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acbb9af8b76fecc11b2ec9e18fbafef58"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#acbb9af8b76fecc11b2ec9e18fbafef58">DUCK_IO_CMD_PLAY_SPEECH</a>&#160;&#160;&#160;0x05u</td></tr>
<tr class="separator:acbb9af8b76fecc11b2ec9e18fbafef58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaaab111d8fc65d794669405084543262"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#aaaab111d8fc65d794669405084543262">DUCK_IO_CMD_RUN_CART_IN_SLOT</a>&#160;&#160;&#160;0x08u</td></tr>
<tr class="separator:aaaab111d8fc65d794669405084543262"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2baed3d9ef122b1a7a4ffe30377a3e27"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a2baed3d9ef122b1a7a4ffe30377a3e27">DUCK_IO_CMD_PRINT_INIT_MAYBE_EXT_IO</a>&#160;&#160;&#160;0x09u</td></tr>
<tr class="separator:a2baed3d9ef122b1a7a4ffe30377a3e27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bc3d136e99b659b1b922fa26c48dd77"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a1bc3d136e99b659b1b922fa26c48dd77">DUCK_IO_CMD_SET_RTC</a>&#160;&#160;&#160;0x0Bu</td></tr>
<tr class="separator:a1bc3d136e99b659b1b922fa26c48dd77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a775c30331ca2f05cfd7545280bb6ee4b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a775c30331ca2f05cfd7545280bb6ee4b">DUCK_IO_CMD_GET_RTC</a>&#160;&#160;&#160;0x0Cu</td></tr>
<tr class="separator:a775c30331ca2f05cfd7545280bb6ee4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade3655df70d9a5941df058f89c9a729c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#ade3655df70d9a5941df058f89c9a729c">DUCK_IO_CMD_PRINT_SEND_BYTES</a>&#160;&#160;&#160;0x11u</td></tr>
<tr class="separator:ade3655df70d9a5941df058f89c9a729c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0da1638f5b490460a1be9f94f1f38e65"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a0da1638f5b490460a1be9f94f1f38e65">DUCK_IO_REPLY_BOOT_UNSET</a>&#160;&#160;&#160;0x00u</td></tr>
<tr class="separator:a0da1638f5b490460a1be9f94f1f38e65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee6403897985744863802a20b91f9c14"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#aee6403897985744863802a20b91f9c14">DUCK_IO_REPLY_BOOT_FAIL</a>&#160;&#160;&#160;0x01u</td></tr>
<tr class="separator:aee6403897985744863802a20b91f9c14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2d016278278f0ea33ac8533806f59e5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#ac2d016278278f0ea33ac8533806f59e5">DUCK_IO_REPLY_BUFFER_XFER_OK</a>&#160;&#160;&#160;0x01u</td></tr>
<tr class="separator:ac2d016278278f0ea33ac8533806f59e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad168ef8090079547a4ada35706f384bb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#ad168ef8090079547a4ada35706f384bb">DUCK_IO_REPLY_SEND_BUFFER_OK</a>&#160;&#160;&#160;0x03u</td></tr>
<tr class="separator:ad168ef8090079547a4ada35706f384bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade7d1856bcbe36407518bdb5bb2b4c9f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#ade7d1856bcbe36407518bdb5bb2b4c9f">DUCK_IO_REPLY_BOOT_OK</a>&#160;&#160;&#160;0x01u</td></tr>
<tr class="separator:ade7d1856bcbe36407518bdb5bb2b4c9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcb564896ac715b4717728266821c96e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#abcb564896ac715b4717728266821c96e">DUCK_IO_LEN_KBD_GET</a>&#160;&#160;&#160;2u</td></tr>
<tr class="separator:abcb564896ac715b4717728266821c96e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90509c967b3604dee5a0844ddda41a4d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a90509c967b3604dee5a0844ddda41a4d">DUCK_IO_LEN_RTC_GET</a>&#160;&#160;&#160;8u</td></tr>
<tr class="separator:a90509c967b3604dee5a0844ddda41a4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a516cd69eb7a05edf91d8333113e1b6d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a516cd69eb7a05edf91d8333113e1b6d2">DUCK_IO_LEN_RTC_SET</a>&#160;&#160;&#160;8u</td></tr>
<tr class="separator:a516cd69eb7a05edf91d8333113e1b6d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bb0196d8cedf4a924c207c7f7700a4d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a4bb0196d8cedf4a924c207c7f7700a4d">DUCK_IO_LEN_PLAY_SPEECH</a>&#160;&#160;&#160;1u</td></tr>
<tr class="separator:a4bb0196d8cedf4a924c207c7f7700a4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3514314114c0e69a470cb06bb01e33a2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a3514314114c0e69a470cb06bb01e33a2">DUCK_IO_REPLY_NO_CART_IN_SLOT</a>&#160;&#160;&#160;06u</td></tr>
<tr class="separator:a3514314114c0e69a470cb06bb01e33a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a982b6bb2c328b8cacb28b90bee72fd4d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a982b6bb2c328b8cacb28b90bee72fd4d">DUCK_IO_LEN_RX_MAX</a>&#160;&#160;&#160;14u</td></tr>
<tr class="separator:a982b6bb2c328b8cacb28b90bee72fd4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cd86d57ca4966dfabd7a29ba2af11ab"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a2cd86d57ca4966dfabd7a29ba2af11ab">DUCK_IO_LEN_TX_MAX</a>&#160;&#160;&#160;14u</td></tr>
<tr class="separator:a2cd86d57ca4966dfabd7a29ba2af11ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa63652e66d320392db092b4f955e60e9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#aa63652e66d320392db092b4f955e60e9">DUCK_IO_TIMEOUT_2_MSEC</a>&#160;&#160;&#160;2u</td></tr>
<tr class="separator:aa63652e66d320392db092b4f955e60e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f30620df7e08a7f3f271b8f466dc380"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a7f30620df7e08a7f3f271b8f466dc380">DUCK_IO_TIMEOUT_100_MSEC</a>&#160;&#160;&#160;100u</td></tr>
<tr class="separator:a7f30620df7e08a7f3f271b8f466dc380"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5068c50f653cf59e1d387508531917f5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a5068c50f653cf59e1d387508531917f5">DUCK_IO_TIMEOUT_200_MSEC</a>&#160;&#160;&#160;200u</td></tr>
<tr class="separator:a5068c50f653cf59e1d387508531917f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a899b2697839b3a8a55cf85621597cbf0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a899b2697839b3a8a55cf85621597cbf0">DUCK_IO_SPEECH_CMD_MIN</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a899b2697839b3a8a55cf85621597cbf0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea7e67628fee0f78e1ee8c58a8ab4838"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#aea7e67628fee0f78e1ee8c58a8ab4838">DUCK_IO_SPEECH_CMD_MAX</a>&#160;&#160;&#160;6</td></tr>
<tr class="separator:aea7e67628fee0f78e1ee8c58a8ab4838"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4db3f8545ffd0175ca4324996aa5c2e6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a4db3f8545ffd0175ca4324996aa5c2e6">DUCK_IO_RTC_YEAR</a>&#160;&#160;&#160;0u</td></tr>
<tr class="separator:a4db3f8545ffd0175ca4324996aa5c2e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a857559af69293d831281a818c7f72c09"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a857559af69293d831281a818c7f72c09">DUCK_IO_RTC_MON</a>&#160;&#160;&#160;1u</td></tr>
<tr class="separator:a857559af69293d831281a818c7f72c09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadf9abfa3e53075cbd96d7fec66bdaf5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#aadf9abfa3e53075cbd96d7fec66bdaf5">DUCK_IO_RTC_DAY</a>&#160;&#160;&#160;2u</td></tr>
<tr class="separator:aadf9abfa3e53075cbd96d7fec66bdaf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae323435deb6eda66a32250c6e6e63fee"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#ae323435deb6eda66a32250c6e6e63fee">DUCK_IO_RTC_WEEKDAY</a>&#160;&#160;&#160;3u</td></tr>
<tr class="separator:ae323435deb6eda66a32250c6e6e63fee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59740f5e694194e70a625e2133dbec87"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a59740f5e694194e70a625e2133dbec87">DUCK_IO_RTC_AMPM</a>&#160;&#160;&#160;4u</td></tr>
<tr class="separator:a59740f5e694194e70a625e2133dbec87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afafff8113bc22605b11c1eae6afd7624"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#afafff8113bc22605b11c1eae6afd7624">DUCK_IO_RTC_HOUR</a>&#160;&#160;&#160;5u</td></tr>
<tr class="separator:afafff8113bc22605b11c1eae6afd7624"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8aeecfc49960d348cc0956719849d529"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a8aeecfc49960d348cc0956719849d529">DUCK_IO_RTC_MIN</a>&#160;&#160;&#160;6u</td></tr>
<tr class="separator:a8aeecfc49960d348cc0956719849d529"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41085549e434d7896cba04376d0e5703"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a41085549e434d7896cba04376d0e5703">DUCK_IO_RTC_SEC</a>&#160;&#160;&#160;7u</td></tr>
<tr class="separator:a41085549e434d7896cba04376d0e5703"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93c53ae7a897998a40f640631baee6d4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a93c53ae7a897998a40f640631baee6d4">DUCK_IO_KBD_FLAGS</a>&#160;&#160;&#160;0u</td></tr>
<tr class="separator:a93c53ae7a897998a40f640631baee6d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af366714812f9067a555c52ea6eff2d67"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#af366714812f9067a555c52ea6eff2d67">DUCK_IO_KBD_KEYCODE</a>&#160;&#160;&#160;1u</td></tr>
<tr class="separator:af366714812f9067a555c52ea6eff2d67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c3cc7352c2873d11e82dca46c4a9a7f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a4c3cc7352c2873d11e82dca46c4a9a7f">DUCK_IO_PRINTER_INIT_MASK</a>&#160;&#160;&#160;0x01u</td></tr>
<tr class="separator:a4c3cc7352c2873d11e82dca46c4a9a7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a200d07d257129821374c64a64f5126ac"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a200d07d257129821374c64a64f5126ac">DUCK_IO_PRINTER_INIT_OK</a>&#160;&#160;&#160;0x01u</td></tr>
<tr class="separator:a200d07d257129821374c64a64f5126ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc1d5cad1930852f03919f9093eec4a5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#abc1d5cad1930852f03919f9093eec4a5">DUCK_IO_PRINTER_INIT_FAIL</a>&#160;&#160;&#160;0x00u</td></tr>
<tr class="separator:abc1d5cad1930852f03919f9093eec4a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa495208fb87146f1e75c9e41c72eb8dd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#aa495208fb87146f1e75c9e41c72eb8dd">DUCK_IO_PRINTER_TYPE_MASK</a>&#160;&#160;&#160;0x02u</td></tr>
<tr class="separator:aa495208fb87146f1e75c9e41c72eb8dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19d0df507afbe887d6cd2623365fa2a4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a19d0df507afbe887d6cd2623365fa2a4">DUCK_IO_PRINTER_TYPE_2_PASS</a>&#160;&#160;&#160;0x00u</td></tr>
<tr class="separator:a19d0df507afbe887d6cd2623365fa2a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b13395ce3ba12e26ae4abe578e9c7d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a7b13395ce3ba12e26ae4abe578e9c7d9">DUCK_IO_PRINTER_TYPE_1_PASS</a>&#160;&#160;&#160;0x02u</td></tr>
<tr class="separator:a7b13395ce3ba12e26ae4abe578e9c7d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1b49f54604e82217cd4f5cd614f749e4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a1b49f54604e82217cd4f5cd614f749e4">duck_io_send_byte</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> tx_byte)</td></tr>
<tr class="separator:a1b49f54604e82217cd4f5cd614f749e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80b681ac57a1dbf5e52bd12dc1ce3b48"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a80b681ac57a1dbf5e52bd12dc1ce3b48">duck_io_read_byte_no_timeout</a> (void)</td></tr>
<tr class="separator:a80b681ac57a1dbf5e52bd12dc1ce3b48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4732e7f2b0ba1690443e4e7f86c5c1fd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a4732e7f2b0ba1690443e4e7f86c5c1fd">duck_io_enable_read_byte</a> (void)</td></tr>
<tr class="separator:a4732e7f2b0ba1690443e4e7f86c5c1fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb11bd7e4cd420d04e39433b9cc47589"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589">duck_io_laptop_init</a> (void)</td></tr>
<tr class="separator:abb11bd7e4cd420d04e39433b9cc47589"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e11278ebd2a981030285ba8999c9a60"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a6e11278ebd2a981030285ba8999c9a60">duck_io_printer_detected</a> (void)</td></tr>
<tr class="separator:a6e11278ebd2a981030285ba8999c9a60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76b5721cbacbc00638246572e34030b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a76b5721cbacbc00638246572e34030b1">duck_io_printer_type</a> (void)</td></tr>
<tr class="separator:a76b5721cbacbc00638246572e34030b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1254526e1e5e39e56957ec6c3eec9a3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#ac1254526e1e5e39e56957ec6c3eec9a3">duck_io_read_byte_with_msecs_timeout</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> timeout_len_ms)</td></tr>
<tr class="separator:ac1254526e1e5e39e56957ec6c3eec9a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b5c7803c1733dd05f896b7c9cbbd7f5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a0b5c7803c1733dd05f896b7c9cbbd7f5">duck_io_send_byte_and_check_ack_msecs_timeout</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> tx_byte, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> timeout_len_ms, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> expected_reply)</td></tr>
<tr class="separator:a0b5c7803c1733dd05f896b7c9cbbd7f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a95edc2f6ab9b8611de1b685de6a34f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a6a95edc2f6ab9b8611de1b685de6a34f">duck_io_send_cmd_and_buffer</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> io_cmd)</td></tr>
<tr class="separator:a6a95edc2f6ab9b8611de1b685de6a34f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d82653ae8b60f4350f58320db1b9706"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a1d82653ae8b60f4350f58320db1b9706">duck_io_send_cmd_and_receive_buffer</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> io_cmd)</td></tr>
<tr class="separator:a1d82653ae8b60f4350f58320db1b9706"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:aa513d5139b0ac1f882f9b251cdf413e5"><td class="memItemLeft" align="right" valign="top">volatile <a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#aa513d5139b0ac1f882f9b251cdf413e5">duck_io_rx_byte_done</a></td></tr>
<tr class="separator:aa513d5139b0ac1f882f9b251cdf413e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd02c3b9793b5de14d828c8f4dd781f6"><td class="memItemLeft" align="right" valign="top">volatile <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#afd02c3b9793b5de14d828c8f4dd781f6">duck_io_rx_byte</a></td></tr>
<tr class="separator:afd02c3b9793b5de14d828c8f4dd781f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4650eb6ec83d91ed9a73c23dfc734f27"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a4650eb6ec83d91ed9a73c23dfc734f27">duck_io_rx_buf</a> [<a class="el" href="laptop__io_8h.html#a982b6bb2c328b8cacb28b90bee72fd4d">DUCK_IO_LEN_RX_MAX</a>]</td></tr>
<tr class="separator:a4650eb6ec83d91ed9a73c23dfc734f27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9dcdcc9bb6fab0018a0a986e618dae3a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a9dcdcc9bb6fab0018a0a986e618dae3a">duck_io_rx_buf_len</a></td></tr>
<tr class="separator:a9dcdcc9bb6fab0018a0a986e618dae3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a963e60419ff150b2cc5d7ada262901f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#a963e60419ff150b2cc5d7ada262901f8">duck_io_tx_buf</a> [<a class="el" href="laptop__io_8h.html#a2cd86d57ca4966dfabd7a29ba2af11ab">DUCK_IO_LEN_TX_MAX</a>]</td></tr>
<tr class="separator:a963e60419ff150b2cc5d7ada262901f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab00abe42f5e98e41a4f6bf09890c7030"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="laptop__io_8h.html#ab00abe42f5e98e41a4f6bf09890c7030">duck_io_tx_buf_len</a></td></tr>
<tr class="separator:ab00abe42f5e98e41a4f6bf09890c7030"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="anchor" id="megaduck_laptop_io_docs"></a></p>
<h1><a class="anchor" id="autotoc_md0"></a>
MegaDuck Laptop Peripheral IO support</h1>
<p>The MegaDuck Laptop models (Spanish and German) have several built-in hardware peripherals which are attached via a controller that is communicated with using the serial link port.</p>
<dl class="section note"><dt>Note</dt><dd>Using the duck_io_* functions referenced from this header file will cause the duck_io_ serial interrupt handler to be automatically installed.</dd></dl>
<p>To use any functions here, <a class="el" href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589">duck_io_laptop_init()</a> must be called first (just once).</p>
<p>For the present time all of the serial operations are blocking, they do not return until completed. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a4a3361568d0c8ca82bcfe8ddfeacf0e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a3361568d0c8ca82bcfe8ddfeacf0e5">&#9670;&nbsp;</a></span>_MEGADUCK_LAPTOP_IO_H</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _MEGADUCK_LAPTOP_IO_H</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad92c78a25f1c8de2615722c7eddfe1da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad92c78a25f1c8de2615722c7eddfe1da">&#9670;&nbsp;</a></span>DUCK_IO_CMD_INIT_START</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_INIT_START&#160;&#160;&#160;0x00u</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Command to request starting the hardware init counter sequence process </p>

</div>
</div>
<a id="a48d85e878da85076ef25868769130cf8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48d85e878da85076ef25868769130cf8">&#9670;&nbsp;</a></span>DUCK_IO_CMD_GET_KEYS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_GET_KEYS&#160;&#160;&#160;0x00u</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Command to get hardware keyboard data by receiving a multi-byte packet </p>

</div>
</div>
<a id="a5731dbc5b3308811e62c457fee15c5c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5731dbc5b3308811e62c457fee15c5c9">&#9670;&nbsp;</a></span>DUCK_IO_CMD_DONE_OR_OK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_DONE_OR_OK&#160;&#160;&#160;0x01u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a460c1f9f52da868754ec07af8f023f33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a460c1f9f52da868754ec07af8f023f33">&#9670;&nbsp;</a></span>DUCK_IO_CMD_ABORT_OR_FAIL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_ABORT_OR_FAIL&#160;&#160;&#160;0x04u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="acbb9af8b76fecc11b2ec9e18fbafef58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acbb9af8b76fecc11b2ec9e18fbafef58">&#9670;&nbsp;</a></span>DUCK_IO_CMD_PLAY_SPEECH</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_PLAY_SPEECH&#160;&#160;&#160;0x05u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aaaab111d8fc65d794669405084543262"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaaab111d8fc65d794669405084543262">&#9670;&nbsp;</a></span>DUCK_IO_CMD_RUN_CART_IN_SLOT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_RUN_CART_IN_SLOT&#160;&#160;&#160;0x08u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a2baed3d9ef122b1a7a4ffe30377a3e27"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2baed3d9ef122b1a7a4ffe30377a3e27">&#9670;&nbsp;</a></span>DUCK_IO_CMD_PRINT_INIT_MAYBE_EXT_IO</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_PRINT_INIT_MAYBE_EXT_IO&#160;&#160;&#160;0x09u</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Command to init the printer and return status + model type </p>

</div>
</div>
<a id="a1bc3d136e99b659b1b922fa26c48dd77"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1bc3d136e99b659b1b922fa26c48dd77">&#9670;&nbsp;</a></span>DUCK_IO_CMD_SET_RTC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_SET_RTC&#160;&#160;&#160;0x0Bu</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Command to set hardware RTC by sending a multi-byte packet </p>

</div>
</div>
<a id="a775c30331ca2f05cfd7545280bb6ee4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a775c30331ca2f05cfd7545280bb6ee4b">&#9670;&nbsp;</a></span>DUCK_IO_CMD_GET_RTC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_GET_RTC&#160;&#160;&#160;0x0Cu</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Command to get hardware RTC by receiving a a multi-byte packet </p>

</div>
</div>
<a id="ade3655df70d9a5941df058f89c9a729c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade3655df70d9a5941df058f89c9a729c">&#9670;&nbsp;</a></span>DUCK_IO_CMD_PRINT_SEND_BYTES</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_CMD_PRINT_SEND_BYTES&#160;&#160;&#160;0x11u</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send printer data </p>

</div>
</div>
<a id="a0da1638f5b490460a1be9f94f1f38e65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0da1638f5b490460a1be9f94f1f38e65">&#9670;&nbsp;</a></span>DUCK_IO_REPLY_BOOT_UNSET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_REPLY_BOOT_UNSET&#160;&#160;&#160;0x00u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aee6403897985744863802a20b91f9c14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee6403897985744863802a20b91f9c14">&#9670;&nbsp;</a></span>DUCK_IO_REPLY_BOOT_FAIL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_REPLY_BOOT_FAIL&#160;&#160;&#160;0x01u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ac2d016278278f0ea33ac8533806f59e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2d016278278f0ea33ac8533806f59e5">&#9670;&nbsp;</a></span>DUCK_IO_REPLY_BUFFER_XFER_OK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_REPLY_BUFFER_XFER_OK&#160;&#160;&#160;0x01u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad168ef8090079547a4ada35706f384bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad168ef8090079547a4ada35706f384bb">&#9670;&nbsp;</a></span>DUCK_IO_REPLY_SEND_BUFFER_OK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_REPLY_SEND_BUFFER_OK&#160;&#160;&#160;0x03u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ade7d1856bcbe36407518bdb5bb2b4c9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade7d1856bcbe36407518bdb5bb2b4c9f">&#9670;&nbsp;</a></span>DUCK_IO_REPLY_BOOT_OK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_REPLY_BOOT_OK&#160;&#160;&#160;0x01u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="abcb564896ac715b4717728266821c96e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abcb564896ac715b4717728266821c96e">&#9670;&nbsp;</a></span>DUCK_IO_LEN_KBD_GET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_LEN_KBD_GET&#160;&#160;&#160;2u</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get Keyboard key payload size: 2 bytes Payload (excludes 1 length header byte, 1 byte Checksum) </p>

</div>
</div>
<a id="a90509c967b3604dee5a0844ddda41a4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90509c967b3604dee5a0844ddda41a4d">&#9670;&nbsp;</a></span>DUCK_IO_LEN_RTC_GET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_LEN_RTC_GET&#160;&#160;&#160;8u</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get RTC payload size: 8 bytes Payload (excludes 1 length header byte, 1 byte Checksum) </p>

</div>
</div>
<a id="a516cd69eb7a05edf91d8333113e1b6d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a516cd69eb7a05edf91d8333113e1b6d2">&#9670;&nbsp;</a></span>DUCK_IO_LEN_RTC_SET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_LEN_RTC_SET&#160;&#160;&#160;8u</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set RTC payload size: 8 bytes Payload (excludes 1 length header byte, 1 byte Checksum) </p>

</div>
</div>
<a id="a4bb0196d8cedf4a924c207c7f7700a4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4bb0196d8cedf4a924c207c7f7700a4d">&#9670;&nbsp;</a></span>DUCK_IO_LEN_PLAY_SPEECH</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_LEN_PLAY_SPEECH&#160;&#160;&#160;1u</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Play Speech payload size: 1 byte Payload (excludes 1 length header byte, 1 byte Checksum) </p>

</div>
</div>
<a id="a3514314114c0e69a470cb06bb01e33a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3514314114c0e69a470cb06bb01e33a2">&#9670;&nbsp;</a></span>DUCK_IO_REPLY_NO_CART_IN_SLOT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_REPLY_NO_CART_IN_SLOT&#160;&#160;&#160;06u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a982b6bb2c328b8cacb28b90bee72fd4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a982b6bb2c328b8cacb28b90bee72fd4d">&#9670;&nbsp;</a></span>DUCK_IO_LEN_RX_MAX</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_LEN_RX_MAX&#160;&#160;&#160;14u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a2cd86d57ca4966dfabd7a29ba2af11ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2cd86d57ca4966dfabd7a29ba2af11ab">&#9670;&nbsp;</a></span>DUCK_IO_LEN_TX_MAX</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_LEN_TX_MAX&#160;&#160;&#160;14u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aa63652e66d320392db092b4f955e60e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa63652e66d320392db092b4f955e60e9">&#9670;&nbsp;</a></span>DUCK_IO_TIMEOUT_2_MSEC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_TIMEOUT_2_MSEC&#160;&#160;&#160;2u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a7f30620df7e08a7f3f271b8f466dc380"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f30620df7e08a7f3f271b8f466dc380">&#9670;&nbsp;</a></span>DUCK_IO_TIMEOUT_100_MSEC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_TIMEOUT_100_MSEC&#160;&#160;&#160;100u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a5068c50f653cf59e1d387508531917f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5068c50f653cf59e1d387508531917f5">&#9670;&nbsp;</a></span>DUCK_IO_TIMEOUT_200_MSEC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_TIMEOUT_200_MSEC&#160;&#160;&#160;200u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a899b2697839b3a8a55cf85621597cbf0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a899b2697839b3a8a55cf85621597cbf0">&#9670;&nbsp;</a></span>DUCK_IO_SPEECH_CMD_MIN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_SPEECH_CMD_MIN&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aea7e67628fee0f78e1ee8c58a8ab4838"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea7e67628fee0f78e1ee8c58a8ab4838">&#9670;&nbsp;</a></span>DUCK_IO_SPEECH_CMD_MAX</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_SPEECH_CMD_MAX&#160;&#160;&#160;6</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a4db3f8545ffd0175ca4324996aa5c2e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4db3f8545ffd0175ca4324996aa5c2e6">&#9670;&nbsp;</a></span>DUCK_IO_RTC_YEAR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_RTC_YEAR&#160;&#160;&#160;0u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a857559af69293d831281a818c7f72c09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a857559af69293d831281a818c7f72c09">&#9670;&nbsp;</a></span>DUCK_IO_RTC_MON</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_RTC_MON&#160;&#160;&#160;1u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aadf9abfa3e53075cbd96d7fec66bdaf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aadf9abfa3e53075cbd96d7fec66bdaf5">&#9670;&nbsp;</a></span>DUCK_IO_RTC_DAY</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_RTC_DAY&#160;&#160;&#160;2u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ae323435deb6eda66a32250c6e6e63fee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae323435deb6eda66a32250c6e6e63fee">&#9670;&nbsp;</a></span>DUCK_IO_RTC_WEEKDAY</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_RTC_WEEKDAY&#160;&#160;&#160;3u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a59740f5e694194e70a625e2133dbec87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59740f5e694194e70a625e2133dbec87">&#9670;&nbsp;</a></span>DUCK_IO_RTC_AMPM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_RTC_AMPM&#160;&#160;&#160;4u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="afafff8113bc22605b11c1eae6afd7624"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afafff8113bc22605b11c1eae6afd7624">&#9670;&nbsp;</a></span>DUCK_IO_RTC_HOUR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_RTC_HOUR&#160;&#160;&#160;5u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a8aeecfc49960d348cc0956719849d529"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8aeecfc49960d348cc0956719849d529">&#9670;&nbsp;</a></span>DUCK_IO_RTC_MIN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_RTC_MIN&#160;&#160;&#160;6u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a41085549e434d7896cba04376d0e5703"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a41085549e434d7896cba04376d0e5703">&#9670;&nbsp;</a></span>DUCK_IO_RTC_SEC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_RTC_SEC&#160;&#160;&#160;7u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a93c53ae7a897998a40f640631baee6d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93c53ae7a897998a40f640631baee6d4">&#9670;&nbsp;</a></span>DUCK_IO_KBD_FLAGS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_KBD_FLAGS&#160;&#160;&#160;0u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="af366714812f9067a555c52ea6eff2d67"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af366714812f9067a555c52ea6eff2d67">&#9670;&nbsp;</a></span>DUCK_IO_KBD_KEYCODE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_KBD_KEYCODE&#160;&#160;&#160;1u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a4c3cc7352c2873d11e82dca46c4a9a7f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c3cc7352c2873d11e82dca46c4a9a7f">&#9670;&nbsp;</a></span>DUCK_IO_PRINTER_INIT_MASK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_PRINTER_INIT_MASK&#160;&#160;&#160;0x01u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a200d07d257129821374c64a64f5126ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a200d07d257129821374c64a64f5126ac">&#9670;&nbsp;</a></span>DUCK_IO_PRINTER_INIT_OK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_PRINTER_INIT_OK&#160;&#160;&#160;0x01u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="abc1d5cad1930852f03919f9093eec4a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc1d5cad1930852f03919f9093eec4a5">&#9670;&nbsp;</a></span>DUCK_IO_PRINTER_INIT_FAIL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_PRINTER_INIT_FAIL&#160;&#160;&#160;0x00u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aa495208fb87146f1e75c9e41c72eb8dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa495208fb87146f1e75c9e41c72eb8dd">&#9670;&nbsp;</a></span>DUCK_IO_PRINTER_TYPE_MASK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_PRINTER_TYPE_MASK&#160;&#160;&#160;0x02u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a19d0df507afbe887d6cd2623365fa2a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19d0df507afbe887d6cd2623365fa2a4">&#9670;&nbsp;</a></span>DUCK_IO_PRINTER_TYPE_2_PASS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_PRINTER_TYPE_2_PASS&#160;&#160;&#160;0x00u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a7b13395ce3ba12e26ae4abe578e9c7d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b13395ce3ba12e26ae4abe578e9c7d9">&#9670;&nbsp;</a></span>DUCK_IO_PRINTER_TYPE_1_PASS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DUCK_IO_PRINTER_TYPE_1_PASS&#160;&#160;&#160;0x02u</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a1b49f54604e82217cd4f5cd614f749e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b49f54604e82217cd4f5cd614f749e4">&#9670;&nbsp;</a></span>duck_io_send_byte()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void duck_io_send_byte </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>tx_byte</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sends a byte over serial to the MegaDuck laptop peripheral</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tx_byte</td><td>Byte to send </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a80b681ac57a1dbf5e52bd12dc1ce3b48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a80b681ac57a1dbf5e52bd12dc1ce3b48">&#9670;&nbsp;</a></span>duck_io_read_byte_no_timeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> duck_io_read_byte_no_timeout </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads a byte over serial from the MegaDuck laptop peripheral with NO timeout</p>
<p>Returns: the received byte</p>
<p>If there is no reply then it will hang forever </p>

</div>
</div>
<a id="a4732e7f2b0ba1690443e4e7f86c5c1fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4732e7f2b0ba1690443e4e7f86c5c1fd">&#9670;&nbsp;</a></span>duck_io_enable_read_byte()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void duck_io_enable_read_byte </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Prepares to receive serial data from the MegaDuck laptop peripheral</p>
<ul>
<li>Sets serial IO to external clock and enables ready state. </li>
<li>Turns on Serial interrupt, clears any pending interrupts and then turns interrupts on (state of <a class="el" href="gb_2hardware_8h.html#aaef0dc6aab2f821ab406fdbc643af48e">IE_REG</a> should be preserved before calling this and then restored at the end of the serial communication being performed). </li>
</ul>

</div>
</div>
<a id="abb11bd7e4cd420d04e39433b9cc47589"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb11bd7e4cd420d04e39433b9cc47589">&#9670;&nbsp;</a></span>duck_io_laptop_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a> duck_io_laptop_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Performs init sequence over serial with the MegaDuck laptop peripheral</p>
<p>Returns <code>true</code> if successful, otherwise <code>false</code></p>
<p>Needs to be done <em>just once</em> any time system is powered on or a cartridge is booted.</p>
<p>Sends count up sequence + some commands, then waits for a matching count down sequence in reverse. </p>

</div>
</div>
<a id="a6e11278ebd2a981030285ba8999c9a60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e11278ebd2a981030285ba8999c9a60">&#9670;&nbsp;</a></span>duck_io_printer_detected()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a> duck_io_printer_detected </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns whether the MegaDuck Printer was detected during <a class="el" href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589">duck_io_laptop_init()</a></p>
<p>Returns <code>true</code> if successful, otherwise <code>false</code></p>
<p><a class="el" href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589">duck_io_laptop_init()</a> must be called first </p>

</div>
</div>
<a id="a76b5721cbacbc00638246572e34030b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a76b5721cbacbc00638246572e34030b1">&#9670;&nbsp;</a></span>duck_io_printer_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> duck_io_printer_type </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns which type of MegaDuck Printer was detected during <a class="el" href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589">duck_io_laptop_init()</a></p>
<p>Return value should be one of the following: </p><ul>
<li><a class="el" href="laptop__io_8h.html#a7b13395ce3ba12e26ae4abe578e9c7d9">DUCK_IO_PRINTER_TYPE_1_PASS</a> (single pass monochrome) </li>
<li><a class="el" href="laptop__io_8h.html#a19d0df507afbe887d6cd2623365fa2a4">DUCK_IO_PRINTER_TYPE_2_PASS</a> (two pass possibly supports shades of grey)</li>
</ul>
<p><a class="el" href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589">duck_io_laptop_init()</a> must be called first </p>

</div>
</div>
<a id="ac1254526e1e5e39e56957ec6c3eec9a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1254526e1e5e39e56957ec6c3eec9a3">&#9670;&nbsp;</a></span>duck_io_read_byte_with_msecs_timeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a> duck_io_read_byte_with_msecs_timeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>timeout_len_ms</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Waits to receive a byte over serial from the MegaDuck laptop peripheral with a timeout</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">timeout_len_ms</td><td>Unit size is in msec (100 is about ~ 103 msec or 6.14 frames)</td></tr>
  </table>
  </dd>
</dl>
<p>Returns: </p><ul>
<li><code>true</code>: Success, received byte will be in <code>duck_io_rx_byte</code> global </li>
<li><code>false</code>: Read timed out with no reply </li>
</ul>

</div>
</div>
<a id="a0b5c7803c1733dd05f896b7c9cbbd7f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b5c7803c1733dd05f896b7c9cbbd7f5">&#9670;&nbsp;</a></span>duck_io_send_byte_and_check_ack_msecs_timeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a> duck_io_send_byte_and_check_ack_msecs_timeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>tx_byte</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>timeout_len_ms</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>expected_reply</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sends a byte over over serial to the MegaDuck laptop peripheral and waits for a reply with a timeout</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tx_byte</td><td>Byte to send </td></tr>
    <tr><td class="paramname">timeout_len_ms</td><td>Unit size is in msec (100 is about ~ 103 msec or 6.14 frames) </td></tr>
    <tr><td class="paramname">expected_reply</td><td>The expected value of the reply byte</td></tr>
  </table>
  </dd>
</dl>
<p>Returns: </p><ul>
<li><code>true</code>: Success </li>
<li><code>false</code>: if timed out or reply byte didn't match expected value </li>
</ul>

</div>
</div>
<a id="a6a95edc2f6ab9b8611de1b685de6a34f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6a95edc2f6ab9b8611de1b685de6a34f">&#9670;&nbsp;</a></span>duck_io_send_cmd_and_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a> duck_io_send_cmd_and_buffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>io_cmd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sends a command and a multi-byte buffer over serial to the MegaDuck laptop peripheral</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">io_cmd</td><td>Command byte to send</td></tr>
  </table>
  </dd>
</dl>
<p>The data should be pre-loaded into these globals: </p><ul>
<li><a class="el" href="laptop__io_8h.html#a963e60419ff150b2cc5d7ada262901f8">duck_io_tx_buf</a> : Buffer with data to send </li>
<li><a class="el" href="laptop__io_8h.html#ab00abe42f5e98e41a4f6bf09890c7030">duck_io_tx_buf_len</a> : Number of bytes to send</li>
</ul>
<p>Returns: <code>true</code> if succeeded</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="laptop__io_8h.html#a48d85e878da85076ef25868769130cf8">DUCK_IO_CMD_GET_KEYS</a>, <a class="el" href="laptop__io_8h.html#a1bc3d136e99b659b1b922fa26c48dd77">DUCK_IO_CMD_SET_RTC</a> </dd></dl>

</div>
</div>
<a id="a1d82653ae8b60f4350f58320db1b9706"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d82653ae8b60f4350f58320db1b9706">&#9670;&nbsp;</a></span>duck_io_send_cmd_and_receive_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a> duck_io_send_cmd_and_receive_buffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>io_cmd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sends a command and then receives a multi-byte buffer over serial from the MegaDuck laptop peripheral</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">io_cmd</td><td>Command byte to send</td></tr>
  </table>
  </dd>
</dl>
<p>If successful, the received data and length will be in these globals: </p><ul>
<li><a class="el" href="laptop__io_8h.html#a4650eb6ec83d91ed9a73c23dfc734f27">duck_io_rx_buf</a> : Buffer with received data </li>
<li><a class="el" href="laptop__io_8h.html#a9dcdcc9bb6fab0018a0a986e618dae3a">duck_io_rx_buf_len</a> : Number of bytes received</li>
</ul>
<p>Returns: <code>true</code> if succeeded, <code>false</code> if failed (could be no reply, failed checksum, etc)</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="laptop__io_8h.html#a775c30331ca2f05cfd7545280bb6ee4b">DUCK_IO_CMD_GET_RTC</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="aa513d5139b0ac1f882f9b251cdf413e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa513d5139b0ac1f882f9b251cdf413e5">&#9670;&nbsp;</a></span>duck_io_rx_byte_done</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">volatile <a class="el" href="stdbool_8h.html#abb452686968e48b67397da5f97445f5b">bool</a> duck_io_rx_byte_done</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="afd02c3b9793b5de14d828c8f4dd781f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd02c3b9793b5de14d828c8f4dd781f6">&#9670;&nbsp;</a></span>duck_io_rx_byte</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">volatile <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> duck_io_rx_byte</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a4650eb6ec83d91ed9a73c23dfc734f27"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4650eb6ec83d91ed9a73c23dfc734f27">&#9670;&nbsp;</a></span>duck_io_rx_buf</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> duck_io_rx_buf[<a class="el" href="laptop__io_8h.html#a982b6bb2c328b8cacb28b90bee72fd4d">DUCK_IO_LEN_RX_MAX</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a9dcdcc9bb6fab0018a0a986e618dae3a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9dcdcc9bb6fab0018a0a986e618dae3a">&#9670;&nbsp;</a></span>duck_io_rx_buf_len</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> duck_io_rx_buf_len</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a963e60419ff150b2cc5d7ada262901f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a963e60419ff150b2cc5d7ada262901f8">&#9670;&nbsp;</a></span>duck_io_tx_buf</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> duck_io_tx_buf[<a class="el" href="laptop__io_8h.html#a2cd86d57ca4966dfabd7a29ba2af11ab">DUCK_IO_LEN_TX_MAX</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ab00abe42f5e98e41a4f6bf09890c7030"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab00abe42f5e98e41a4f6bf09890c7030">&#9670;&nbsp;</a></span>duck_io_tx_buf_len</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> duck_io_tx_buf_len</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
